import request from '@/utils/request';
import type { MachineTypeQuery, MachineTypeVO, MachineTypeForm } from './types';

// 查询机器类型列表
export function listMachineType(query: MachineTypeQuery) {
    return request({
        url: '/vending/machineType/list',
        method: 'get',
        params: query
    });
}

// 获取机器类型详细信息
export function getMachineType(id: number) {
    return request({
        url: '/vending/machineType/' + id,
        method: 'get'
    });
}

// 新增机器类型
export function addMachineType(data: MachineTypeForm) {
    return request({
        url: '/vending/machineType',
        method: 'post',
        data: data
    });
}

// 修改机器类型
export function updateMachineType(data: MachineTypeForm) {
    return request({
        url: '/vending/machineType',
        method: 'put',
        data: data
    });
}

// 删除机器类型
export function delMachineType(ids: number[]) {
    return request({
        url: '/vending/machineType/' + ids.join(','),
        method: 'delete'
    });
}

// 批量删除机器类型
export function delBatchMachineType(ids: number[]) {
    return request({
        url: '/vending/machineType/batch/' + ids,
        method: 'delete'
    });
} 